
#include "scene.h"
#include "../math/mat4.h"

Scene::Scene(std::string sceneName)
{
    this->_sceneName = sceneName;
}
void Scene::addChild(Node *node)
{
    this->children.push_back(node);
    node->parent = nullptr;
}

void Scene::update(float dt)
{
    for (auto it = this->children.begin(); it != this->children.end();)
    {
        this->_nodeChildUpdate(*it, dt);
        it++;
    }
}
void Scene::_nodeChildUpdate(Node *node, float dt){
    node->update(dt);
    for (auto it = node->children.begin(); it != node->children.end();)
    {
        this->_nodeChildUpdate(*it, dt);
        it++;
    }
}

Scene::~Scene()
{
}
